#include "app_pool.h"


pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void fun(void *args)
{
    int value = *(int *)args;
    pthread_mutex_lock(&mutex);
    printf("线程 %d\n", value);
    pthread_mutex_unlock(&mutex);
}
int main(void)
{
    App_Pool_Init(10);
    for (size_t i = 0; i < 10; i++)
    {
        int *p = malloc(sizeof(int));
        *p = i;
        App_Pool_AddFun2Task(fun, p);
    }
    sleep(100000);

    return 0;
}